﻿namespace SBlogCore.Common.CacheExtend.Attributes
{
    /// <summary>
    /// 该特性被用于接口缓存，当参数以及接口一样的时候会被缓存起来
    /// </summary>
    public class ServiceAopCacheAttribute : Attribute
    {
        public ServiceAopCacheAttribute(string key, int outTime = 60)
        {
            KeyName = key;
            OutTime = outTime;
        }
        public ServiceAopCacheAttribute(int outTime = 60)
        {
            OutTime = outTime;
        }
        public int OutTime { get; set; }
        /// <summary>
        /// 如果KeyName有值则不考虑参数，甚至不考虑接口
        /// </summary>
        public string? KeyName { get; set; }
    }
}
